// Core data types for Hustle AI Marketplace

export interface Agent {
    id: string;
    name: string;
    description: string;
    category:
        | "coding"
        | "writing"
        | "analysis"
        | "automation"
        | "creative"
        | "agentic-framework"
        | "chatbot-builder"
        | "low-code-builder"
        | "digital-worker";
    pricing: {
        model: "free" | "freemium" | "paid";
        price?: number;
        currency?: string;
        usageLimit?: number;
    };
    capabilities: {
        apiCalls: string[];
        thirdPartyLibraries: string[];
        knowledgeBase: string[];
        customConfiguration: Record<string, any>;
    };
    metadata: {
        createdAt: Date;
        updatedAt: Date;
        creatorId: string;
        usageCount: number;
        rating: number;
        reviews: Review[];
        githubStars?: number;
        logo?: string;
    };
    status: "active" | "inactive" | "pending";
}

export interface Team {
    id: string;
    name: string;
    description: string;
    projectRequirements: string;
    selectedAgents: string[]; // Agent IDs
    configuration: {
        workflow: WorkflowStep[];
        budget: number;
        timeline: string;
    };
    metadata: {
        createdAt: Date;
        updatedAt: Date;
        creatorId: string;
        status: "active" | "completed" | "paused";
    };
}

export interface User {
    id: string;
    email: string;
    name: string;
    avatar?: string;
    preferences: {
        theme: "light" | "dark";
        language: string;
        notifications: boolean;
    };
    subscription: {
        plan: "free" | "pro" | "enterprise";
        expiresAt?: Date;
    };
    metadata: {
        createdAt: Date;
        lastLoginAt: Date;
        totalSpent: number;
    };
}

export interface SearchFilters {
    query: string;
    categories: string[];
    pricing: ("free" | "freemium" | "paid")[];
    rating: {
        min: number;
        max: number;
    };
    features: string[];
    sortBy: "relevance" | "price" | "rating" | "newest";
    sortOrder: "asc" | "desc";
}

export interface Review {
    id: string;
    userId: string;
    agentId: string;
    rating: number;
    comment: string;
    createdAt: Date;
}

export interface WorkflowStep {
    id: string;
    name: string;
    description: string;
    agentId: string;
    order: number;
    configuration: Record<string, any>;
}

// API Response types
export interface ApiResponse<T> {
    data: T;
    success: boolean;
    message?: string;
    error?: string;
}

export interface PaginatedResponse<T> {
    data: T[];
    pagination: {
        page: number;
        limit: number;
        total: number;
        totalPages: number;
    };
}

// Form data types
export interface AgentFormData {
    name: string;
    description: string;
    category: string;
    pricing: {
        model: "free" | "freemium" | "paid";
        price?: number;
        currency?: string;
        usageLimit?: number;
    };
    capabilities: {
        apiCalls: string[];
        thirdPartyLibraries: string[];
        knowledgeBase: string[];
        customConfiguration: Record<string, any>;
    };
}

export interface TeamFormData {
    name: string;
    description: string;
    projectRequirements: string;
    selectedAgents: string[];
    configuration: {
        workflow: WorkflowStep[];
        budget: number;
        timeline: string;
    };
}

// Platform statistics
export interface PlatformStats {
    totalAgents: number;
    totalTeams: number;
    totalUsers: number;
    totalRevenue: number;
    averageRating: number;
}
